<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'grade_manager.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script language="javascript">

		function adminDel(userId)
           {
               if(confirm('您确定删除吗？'))
               {	
              
                   window.location.href="<%=path %>/servlet/DeleteGrade?userId="+userId;
               }
           }
		</script>
  </head>
  
  <body>
  <h5>${message}</h5>
		<table width="98%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
			<tr bgcolor="#E7E7E7">
				<td height="14" colspan="6" align='center'>&nbsp;学生成绩&nbsp;</td>
			</tr>
			<tr align="center" bgcolor="#FAFAF1" height="22">
				<td width="15%">学号</td>
				<td width="15%">学生名</td>
				<td width="15%">课程名</td>
				<td width="15%">任课老师</td>
				<td width="15%">学分</td>
				<td width="15%">成绩</td>
				<td width="10%">操作</td>
			</tr>
			<c:forEach items="${grade}" var="s">
				<tr align='center' bgcolor="#FFFFFF" height="22">
					<td bgcolor="#FFFFFF" align="center">
						${s.s_id}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${s.username}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${s.c_name}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${s.teacher}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${s.score}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						${s.grade}
					</td>
					<td bgcolor="#FFFFFF" align="center">
						<a href="#" onclick="admindel(${s.s_id})">删除</a>
						<a href="<%=path %>/UpdateGradeT?username=${s.username}">修改</a>
					</td>
				</tr>
			</c:forEach>
		</table>
	</body>

</html>